package com.bootdo.backlist.form;

import com.bootdo.common.interfaces.Add;
import com.bootdo.common.interfaces.Update;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author Zengcx
 * @date 2019-04-16 09:16
 */
@Data
public class NoteCodeForm {

    @NotBlank(message = "手机号不能为空",groups = {Add.class, Update.class})
    private String phone;

    @NotBlank(message = "验证码不能为空",groups = {Update.class})
    private String code;

    /**
     * 验证码类型，1为注册，2为找回密码
     */
    @NotNull(message = "验证码类型不能为空",groups = {Add.class})
    private Integer codeType;

    public NoteCodeForm(@NotBlank(message = "手机号不能为空", groups = {Add.class, Update.class}) String phone, @NotBlank(message = "验证码不能为空", groups = {Update.class}) String code) {
        this.phone = phone;
        this.code = code;
    }

    public NoteCodeForm() {
    }
}
